package top.fengleifeng.question;

import java.util.Arrays;

/**
 * @program: leetcode-test
 * @description:
 * @author: fengleifeng
 * @create: 2020-10-19 17:33
 **/
public class Num179最大数 {
    class Solution {
        public String largestNumber(int[] nums) {
            String[] strings = new String[nums.length];
            for (int i = 0; i < nums.length; i++) {
                strings[i] = nums[i] + "";
            }
            Arrays.sort(strings);
            StringBuilder sb = new StringBuilder();
            for (int i = strings.length - 1; i >=0; i--) {
                sb.append(strings[i]);
            }
            return sb.toString();
        }
    }

    public static void main(String[] args) {
        int[] ints = {4,3, 30, 34, 5, 9};
        String s = new Num179最大数().new Solution().largestNumber(ints);
        System.out.println(s);

    }
}
